<%@ page contentType="text/html;charset=utf-8" %>
<%@page import="com.leruan.aasimp.entity.Board"%>
<%@page import="java.util.List"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String sensitiveString = request.getParameter("sensitiveString");
List<Board> boards = (List<Board>)request.getAttribute("boards");
 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<LINK href="<%=path %>/mok/forum/admin/style/admin.css" type=text/css rel=stylesheet></LINK>
<SCRIPT src="../../forum/js/common.js" type=text/javascript></SCRIPT>
<SCRIPT src="../admin/js/admin.js" type=text/javascript></SCRIPT>
</HEAD>
<BODY topMargin=10>
<TABLE cellSpacing=6 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE class=guide cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR>
          <TD><A onclick="parent.location='../index.htm'; return false;" 
            href="#">后台管理首页</A>&nbsp;&raquo;&nbsp;词语过滤记录</TD></TR></TBODY></TABLE><BR>
	<FORM id="frmsearch" name="frmsearch" action="sensitiveSearch" method="get">
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD colSpan=3>词语过滤记录&nbsp;-&nbsp; 过滤条件</TD></TR>
          <TR class="altbg2"><TD width="25%">板块:</TD>
            <TD width="55%">
            <select id="boardId" name="boardId">
                  <%
                  String boardId = request.getParameter("boardId");
                  for(Board b:boards){
                  String selected  = b.getBoardId().equals(boardId)?" selected=\"selected\"" : "";
                  %>
                     <option value="<%=b.getBoardId() %>" <%=selected %>><%=b.getBoardName() %></option>
                  
                  <%
                  }
                   %>
            </select>
            </TD>
            <TD width="20%"><input class="button" type="submit" value="提 交"></TD></TR>
          
		<TR class="altbg2"><TD width="25%">敏感词:</TD>
			<TD width="55%"><input type="text" name="sensitiveString" size="50" maxlength="20" value="<%=null==sensitiveString?"":sensitiveString %>"></TD>
			<TD width="20%"><input class="button" type="submit" value="提 交"></TD></TR>
        </TBODY></TABLE>
	  </FORM>
      <TABLE class=info_tb cellSpacing=0 cellPadding=0 width="100%" border=0>
        <TBODY>
        <TR class=header>
          <TD width="12%">用户名</TD>
          <TD width="15%">时间</TD>
          <TD width="15%">版块</TD>
          <TD width="18%">敏感词</TD></TR>
          <c:forEach var="sensitive" items="${sensitiveList}">
	        <TR align=middle>
	          <TD class=altbg1> ${sensitive.username }</TD>
	          <TD class=altbg2>${sensitive.time }</TD>
	          <TD class=altbg1>${sensitive.boardName }</TD>
	          <TD class=altbg2>${sensitive.sensitivestring }</TD>
			</TR>
          </c:forEach>
	</TBODY></TABLE>
	<div class="pageNo" id="pageNo">
                <a href="sensitiveQuery?no=1&boardId=<%=boardId %>&sensitiveString=<%=sensitiveString %>">首页</a>
                <c:if test="${sessionScope.pageNoSale != 1}">
                    <a href="sensitiveQuery?no=${sessionScope.pageNoSale-1}&boardId=<%=boardId %>&sensitiveString=<%=sensitiveString %>">上一页</a>
                </c:if>
                <c:forEach var="i" begin="${sessionScope.pageNoCenterSale -2 }"
                    end="${sessionScope.pageNoCenterSale + 2}">
                    <c:if test="${i <= sessionScope.totalNoSale }">
                        <c:choose>
                            <c:when test="${i == sessionScope.pageNoSale}">
                                <a href="javascript:void(0)">${i}</a>
                            </c:when>
                            <c:otherwise>
                                <a href="sensitiveQuery?no=${i}&boardId=<%=boardId %>&sensitiveString=<%=sensitiveString %>">${i}</a>
                            </c:otherwise>
                        </c:choose>
                    </c:if>
                </c:forEach>
                <c:if test="${sessionScope.pageNoSale +4 < sessionScope.totalNoSale}">
                    <a href="sensitiveQuery?no=${sessionScope.pageNoSale+1}&boardId=<%=boardId %>&sensitiveString=<%=sensitiveString %>">下一页</a>
                </c:if>
                <a href="sensitiveQuery?no=${sessionScope.totalNoSale}&boardId=<%=boardId %>&sensitiveString=<%=sensitiveString %>">末页</a>
                &nbsp;&nbsp;&nbsp;&nbsp;共有<label style="color: red;">${sessionScope.totalSale}</label>条信息
            </div>
</TD></TR></TBODY></TABLE>
<script language="javascript">
function viewPage(pageno)
{
	frmsearch.page.value = pageno;
	frmsearch.submit();
}
function checkfields(theform) {
    var filter = /^\d+$/;
    if (!filter.test(trim(theform.resultCount.value))) {
    	alert('每页显示记录数量必须为整数');
      	theform.resultCount.focus();
		return;
    }
	theform.submit();
}
frmsearch.resultCount.value = "";
frmsearch.reason.value = "";
</script>	  
</BODY></HTML>
